home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 1998 August / PC Plus SuperCD 50a Issue 142 (CD142a) (August 1998).iso / handson / supercede / Knowodys / Projects / AddText / 1.1 / MainComponent / Form1.class (.txt) next >
Encoding:
Java Class File  |  1997-07-20  |  2.9 KB  |  83 lines

  1. import com.supercede.beans.stdawt.TextAreaSB;
  2. import com.supercede.forms.SuperCedeFrame;
  3. import com.supercede.forms.SuperCedeInvalidStateException;
  4. import java.awt.Button;
  5. import java.awt.Container;
  6. import java.awt.Frame;
  7. import java.awt.TextField;
  8. import java.awt.event.ActionEvent;
  9. import java.awt.event.WindowEvent;
  10. import java.io.IOException;
  11. import java.io.Serializable;
  12. import java.util.Vector;
  13.  
  14. public class Form1 extends SuperCedeFrame implements Serializable {
  15.    TextField inputField;
  16.    Button addButton;
  17.    Button clearButton;
  18.    TextAreaSB myTextArea;
  19.  
  20.    public void form1WindowClosing(WindowEvent var1) {
  21.       ((Frame)this).dispose();
  22.    }
  23.  
  24.    public void form1WindowClosed(WindowEvent var1) {
  25.       this.SuperCedeWindowClosed();
  26.    }
  27.  
  28.    public void inputFieldActionPerformed(ActionEvent var1) {
  29.       this.myTextArea.append(this.inputField.getText() + "\n");
  30.       this.inputField.selectAll();
  31.       this.inputField.requestFocus();
  32.    }
  33.  
  34.    public void addButtonActionPerformed(ActionEvent var1) {
  35.       this.myTextArea.append(this.inputField.getText() + "\n");
  36.       this.inputField.selectAll();
  37.       this.inputField.requestFocus();
  38.    }
  39.  
  40.    public void clearButtonActionPerformed(ActionEvent var1) {
  41.       this.myTextArea.setText("");
  42.       this.inputField.requestFocus();
  43.    }
  44.  
  45.    public Form1() throws IOException, ClassNotFoundException, ClassCastException, SuperCedeInvalidStateException {
  46.       this.SuperCedeConstructor();
  47.    }
  48.  
  49.    public static void main(String[] var0) {
  50.       try {
  51.          Form1 var1 = new Form1();
  52.          ((SuperCedeFrame)var1).setVisible(true);
  53.       } catch (Throwable var2) {
  54.          System.out.println("Cannot construct the form: " + var2);
  55.          System.exit(1);
  56.       }
  57.  
  58.    }
  59.  
  60.    private void SuperCedeConstructor() throws IOException, ClassNotFoundException, ClassCastException, SuperCedeInvalidStateException {
  61.       Vector var1 = new Vector(5);
  62.       var1.addElement(new Form1WindowClosingConnector0());
  63.       var1.addElement(new Form1WindowClosedConnector1());
  64.       var1.addElement(new Form1EventConnector3());
  65.       var1.addElement(new Form1EventConnector4());
  66.       var1.addElement(new Form1EventConnector5());
  67.       super.initializeThis(var1);
  68.       int var2 = 0;
  69.       int var5 = var2++;
  70.       this.inputField = (TextField)((Container)this).getComponent(var5);
  71.       int var8 = var2++;
  72.       this.addButton = (Button)((Container)this).getComponent(var8);
  73.       int var11 = var2++;
  74.       this.clearButton = (Button)((Container)this).getComponent(var11);
  75.       int var14 = var2++;
  76.       this.myTextArea = (TextAreaSB)((Container)this).getComponent(var14);
  77.    }
  78.  
  79.    private void SuperCedeWindowClosed() {
  80.       System.exit(0);
  81.    }
  82. }
  83.